package dparish.server.dao;

import com.google.web.bindery.requestfactory.shared.ServiceLocator;

/**
 *  Generic service locator needed by GWT request factory
 *  @see <a href="http://turbomanage.wordpress.com/2011/03/25/using-gwt-requestfactory-with-objectify/">RequestFactory with Objectify</a>
 */
public class DaoServiceLocator  implements ServiceLocator{

	@Override
	public Object getInstance(Class<?> clazz) {
		try {
			return clazz.newInstance();
		} catch (InstantiationException e) {
			throw new RuntimeException(e);
		} catch (IllegalAccessException e) {
			throw new RuntimeException(e);
		}
	}

}
